<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: 12
  Date: 2023/2/27
  Time: 15:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>application作用域</title>
</head>
<body>
    <%
        // application同一个应用程序内有效
        List books = new ArrayList();
        books.add("《三国演义》");
        books.add("《水浒传》");
        books.add("《西游记》");
        books.add("《红楼梦》");
        application.setAttribute("books",books);
        // 进行页面跳转，这是转发，一次请求
        request.getRequestDispatcher("/list.jsp").forward(request,response);
        // 进行页面跳转，这是重定向，两次请求
        //response.sendRedirect("/list.jsp");
    %>
</body>
</html>
